package com.example.mvp

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import com.example.mvp.databinding.ActivityMainBinding
import com.example.mvp.view.BaseActivity

class MainActivity: BaseActivity<UserInfoPresenter, IUserInfoView>(), IUserInfoView{
    companion object {
        const val TAG = "MainActivity"
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val layoutBinding = ActivityMainBinding.inflate(LayoutInflater.from(this))
        setContentView(layoutBinding.root)
        layoutBinding.btn.setOnClickListener {
            presenter?.showUserInfo()
        }
    }

    override fun showUserInfo(userInfo: UserInfo) {
        Log.d(TAG, "showUserInfo(), userInfo=$userInfo")
    }

    override fun createPresenter(): UserInfoPresenter {
        return UserInfoPresenter()
    }


}